package com.huatai.bi.enums;

import java.util.HashMap;
import java.util.Map;

public enum ProcessEnum {
	FILTER("filter","过滤"),
	CALCULATION("calculation","字段计算"),
	GROUP("group","分组赋值"),
	SUM("sum","数据汇总"),
	UNION("union","数据集合并"),
	POLYMERIC("polymeric","聚合指标");

	static Map<String,ProcessEnum> map = new HashMap<>();
	static {
		map.put("filter",FILTER);
		map.put("calculation",CALCULATION);
		map.put("group",GROUP);
		map.put("sum",SUM);
		map.put("union",UNION);
		map.put("polymeric",POLYMERIC);
	}

	public String type;
	public String name;
	ProcessEnum(String type,String name){
		this.type = type;
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public String getName() {
		return name;
	}

	public static ProcessEnum get(String type){
		if(map.containsKey(type)){
			return map.get(type);
		}
		return null;
	}
}
